wget http://download.redis.io/releases/redis-5.0.14.tar.gz
tar xf redis-5.0.14.tar.gz
cd redis-5.0.14
make
cp redis.conf /etc/
sed -i -e 's/appendonly no/appendonly yes/g' /etc/redis.conf 

sed -i 's@^bind 127.0.0.1@bind 0.0.0.0@g' /etc/redis.conf

cp src/redis-server /usr/local/bin
cp src/redis-cli /usr/local/bin

echo '[Unit]
Description=redis
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
ExecStart=/usr/local/bin/redis-server /etc/redis.conf
RestartSec=20
Restart=always

[Install]
WantedBy=multi-user.target
' > /etc/systemd/system/redis.service

systemctl enable redis
systemctl start redis
